<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:ctl="http://arche.auction.co.kr/WebControl/XmlControl" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:s="http://schema.auction.co.kr/Arche.Members.xsd" xmlns:ms="urn:schemas-microsoft-com:xslt"
	xmlns:ARCHE="http://www.auction.co.kr/xsltFunc" exclude-result-prefixes="ctl s">
	
	<xsl:param name="DegreeImageType" />
	<xsl:param name="IsDisplayPercent" />
	<xsl:param name="Satisfaction" />
	<xsl:param name="SatisfactionPercent" />
	
	<!--
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  Start TEMPLATE
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  -->
<xsl:template match="//*">
	<xsl:choose>
		<xsl:when test="@Satisfaction &gt; 0 or @SatisfactionPercent &gt; 0">
			<xsl:call-template name="PrintStar">
				<xsl:with-param name="DegreeImageType" select="$DegreeImageType" />
				<xsl:with-param name="IsDisplayPercent" select="$IsDisplayPercent" />
				<xsl:with-param name="Satisfaction" select="@Satisfaction" />
				<xsl:with-param name="SatisfactionPercent" select="@SatisfactionPercent" />
			</xsl:call-template>		
		</xsl:when>
		<xsl:otherwise>
			<xsl:call-template name="PrintStar">
				<xsl:with-param name="DegreeImageType" select="$DegreeImageType" />
				<xsl:with-param name="IsDisplayPercent" select="$IsDisplayPercent" />
				<xsl:with-param name="Satisfaction" select="$Satisfaction" />
				<xsl:with-param name="SatisfactionPercent" select="$SatisfactionPercent" />
			</xsl:call-template>
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>
  
<!--
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  PrintStar Template
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  -->
 
<xsl:template name="PrintStar">
<xsl:param name="DegreeImageType" />
<xsl:param name="IsDisplayPercent" />
<xsl:param name="Satisfaction" />
<xsl:param name="SatisfactionPercent" />
<TD align="center">
	<TABLE border="0" cellPadding="0" cellSpacing="0">
	<TR>
		<TD align="center">
		<xsl:choose>
			<xsl:when test="$Satisfaction &gt; 0">
				<xsl:call-template name="StarImage">
					<xsl:with-param name="DegreeImageType" select="$DegreeImageType" />
					<xsl:with-param name="StarCount" select="substring($Satisfaction,1,1)" />
					<xsl:with-param name="RestCount" select="substring($Satisfaction,2,1)" />
					<xsl:with-param name="SatisfactionPercent" select="$SatisfactionPercent" />
					<xsl:with-param name="IsDisplayPercent" select="$IsDisplayPercent" />
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				일반
			</xsl:otherwise>
		</xsl:choose>
		</TD>
	</TR>
	</TABLE>
</TD>
</xsl:template>
 
<!--
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  StarImage Template
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  --> 
<xsl:template name="StarImage">
<xsl:param name="DegreeImageType" />
<xsl:param name="StarCount" />
<xsl:param name="RestCount" />
<xsl:param name="IsDisplayPercent" />
<xsl:param name="SatisfactionPercent" />
<xsl:choose>
<xsl:when test="$StarCount &gt; 0">
	<xsl:choose>
	<xsl:when test="$DegreeImageType='BigStar'">
		<IMG src="http://pics.auction.co.kr/icon/star2.gif" alt="별"/>
	</xsl:when>
	<xsl:otherwise>
		<IMG src="http://pics.auction.co.kr/icon/star1.gif"/>
	</xsl:otherwise>
	</xsl:choose>
		
	<xsl:call-template name="StarImage">
		<xsl:with-param name="StarCount" select="$StarCount - 1" />
		<xsl:with-param name="RestCount" select="$RestCount" />
		<xsl:with-param name="DegreeImageType" select="$DegreeImageType" />
		<xsl:with-param name="IsDisplayPercent" select="$IsDisplayPercent" />
		<xsl:with-param name="SatisfactionPercent" select="$SatisfactionPercent" />
	</xsl:call-template>
</xsl:when>
<xsl:otherwise>
	<xsl:choose>
		<xsl:when test="$RestCount &gt; 0">
			<xsl:choose>
			<xsl:when test="$DegreeImageType='BigStar'">
				<IMG src="http://pics.auction.co.kr/icon/star2_half.gif" alt="별"/>
				<xsl:if test="$IsDisplayPercent='true' and $SatisfactionPercent > 0">
					<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
					<strong class="org fsxl"><xsl:value-of select="$SatisfactionPercent"/>%</strong>
				</xsl:if>
			</xsl:when>
			<xsl:otherwise>
				<IMG src="http://pics.auction.co.kr/icon/star_half.gif"/>
				<xsl:if test="$IsDisplayPercent='true' and $SatisfactionPercent > 0">
					(<xsl:value-of select="$SatisfactionPercent"/>%)
				</xsl:if>
			</xsl:otherwise>
			</xsl:choose>
		</xsl:when>
		<xsl:otherwise>
			<xsl:choose>
				<xsl:when test="$DegreeImageType='BigStar'">
					<xsl:if test="$IsDisplayPercent='true' and $SatisfactionPercent > 0">
						<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
						<strong class="org fsxl"><xsl:value-of select="$SatisfactionPercent"/>%</strong>
					</xsl:if>
				</xsl:when>
				<xsl:otherwise>
					<xsl:if test="$IsDisplayPercent='true' and $SatisfactionPercent > 0">
						(<xsl:value-of select="$SatisfactionPercent"/>%)
					</xsl:if>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:otherwise>
	</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
</xsl:stylesheet>
